// 通过vue-router实现模版路由配置
import { createRouter, createWebHashHistory } from 'vue-router'
import { constantRouter } from './routes'

// 1.1 create
const router = createRouter({
  // route mode hash|history
  history: createWebHashHistory(),
  routes: constantRouter,
  // 滚动行为
  // scrollBehavior: () => ({ left: 0, top: 0 })
  scrollBehavior() {
    return {
      left: 0,
      top: 0,
    }
  },
})

// 1.2 export
export default router
